<?php

namespace App\Api\Controllers;

use App\Models\Commodity;
use Illuminate\Http\Request;

class MachinesController extends Controller
{
    public function index(Commodity $machines){
        $lists = $machines->orderBy('sort','desc')->get();
        foreach ($lists as &$v){
            $v->img = config('conf.img_path').$v->img;
        }
        return $this->success($lists);
    }

    public function show(Commodity $machines){
        $machines->img = config('conf.img_path').$machines->img;
        return $this->success($machines);
    }
}
